alias logo return  $+ $c1 $+ upeZeo ipt $+ $c2 $+ 
alias /fserchan {
  /window -al +Ltn  @fserchan
  /clear @fserchan
  /aline @fserchan  $logo  $c1 $+ %author $+ $c2 
  /aline @fserchan ============================================================
  /aline @fserchan Trigger $c1 %fs.trig $c2
  /aline @fserchan Max Gets $c1 %maxs $c2
  /aline @fserchan Max Users $c1 %fs.alls $c2
  /aline @fserchan Home Directory $c1 %fs.dir $c2
  /aline @fserchan Note $c1 %fs.cont $c2
  /aline @fserchan Connection $c1 %fs.con $c2
  /aline @fserchan Delay Between Ads $c1 %fs.dly $c2
  /aline @fserchan ============================================================
  /aline @fserchan Channels To advertise to
  /aline @fserchan Channel 1  $c1 %chan1 $c2
  /aline @fserchan Channel 2  $c1 %chan2 $c2
  /aline @fserchan Channel 3  $c1 %chan3 $c2
  /aline @fserchan Channel 4  $c1 %chan4 $c2
  /aline @fserchan Channel 5  $c1 %chan5 $c2
  /aline @fserchan Channel 6  $c1 %chan6 $c2
}

menu @fserchan {
  dclick {
    if ($1 == 1) { halt }
    if ($1 == 2) { halt }
    if ($1 == 3) { set %fs.trig $?="What Is Your Fserv Trigger? $crlf $+ To clear Press Cancel" | clear | fserchan | halt }
    if ($1 == 4) { set %maxs $?="Enter Maximum Gets $crlf $+ To clear Press Cancel" | clear | fserchan | halt }
    if ($1 == 5) { set %fs.alls $?="Enter Max Users $crlf $+ To clear Press Cancel" | clear | fserchan | halt }
    if ($1 == 6) { set %fs.dir $sdir="Enter Home Directory MUST NOT HAVE ANY SPACES! $crlf $+ To clear Press Cancel" | clear | fserchan | halt }
    if ($1 == 7) { set %fs.cont $?="What Are You Serving? $crlf $+ To clear Press Cancel" | clear | fserchan | halt }
    if ($1 == 8) { set %fs.con $?="What Connection Are You On? $crlf $+ To clear Press Cancel" | clear | fserchan | halt }
    if ($1 == 9) { set %fs.dly $?="Enter Seconds Between Addys? $crlf $+ To clear Press Cancel" | clear | fserchan | halt }
    if ($1 == 10) { halt }
    if ($1 == 11) { halt }
    if ($1 == 12) { set %chan1 $?="Enter Channel 1, (include #) $crlf $+ To unset please press 'Cancel'" | clear | fserchan | halt }
    if ($1 == 13) { set %chan2 $?="Enter Channel 2, (include #) $crlf $+ To unset please press 'Cancel'" | clear | fserchan | halt }
    if ($1 == 14) { set %chan3 $?="Enter Channel 3, (include #) $crlf $+ To unset please press 'Cancel'" | clear | fserchan | halt }
    if ($1 == 15) { set %chan4 $?="Enter Channel 4, (include #) $crlf $+ To unset please press 'Cancel'" | clear | fserchan | halt }
    if ($1 == 16) { set %chan5 $?="Enter Channel 5, (include #) $crlf $+ To unset please press 'Cancel'" | clear | fserchan | halt }
    if ($1 == 17) { set %chan6 $?="Enter Channel 6, (include #) $crlf $+ To unset please press 'Cancel'" | clear | fserchan | halt }
    if ($1 == 18) { halt }

  }
}

ON *:TEXT:%fs.trig:#: {
  inc %FS.Trigge 1 
  if (%fs == OFF) { /Notice $nick My Fileserver Is Currently Off | halt } 
  if ($fserv(0) == %fs.alls) { /notice $nick All User Slots Are In Use | halt } 
  FSERVE $nick 1 %fs.dir %fs.txt 
}

alias fservad {
  if (%chan1 == $null) { halt } 
  else { /msg %chan1 $c1 $+ Fileserver Online $+ $c2 $c1 $+ Trigger =  $+ %fs.trig $+  $+ $c2 $c1 $+ Sends = $send(0) $+ / $+ %maxs $+ $c2 $c1 $+ Online = $fserv(0) $+ / $+ %fs.alls $+ $c2 $c1 $+ Acessed = %Fs.trigge Time(s)  $+ $c2 $c1 $+ Files = $findfile(%fs.dir,*,0) $+ $c2 
  /msg %chan1 $c1 $+ Maxcps = $round($calc(%top.cps / 1024),2) Kbps $+ $c2 $c1 $+ Note =  $+ %fs.cont $+  $+ $c2 $logo }
  if (%chan2 == $null) { halt } 
  else { /msg %chan2 $c1 $+ Fileserver Online $+ $c2 $c1 $+ Trigger =  $+ %fs.trig $+  $+ $c2 $c1 $+ Sends = $send(0) $+ / $+ %maxs $+ $c2 $c1 $+ Online = $fserv(0) $+ / $+ %fs.alls $+ $c2 $c1 $+ Acessed = %Fs.trigge Time(s)  $+ $c2 $c1 $+ Files = $findfile(%fs.dir,*,0) $+ $c2 
  /msg %chan2 $c1 $+ Maxcps = $round($calc(%top.cps / 1024),2) Kbps $+ $c2 $c1 $+ Note =  $+ %fs.cont $+  $+ $c2 $logo }
  if (%chan3 == $null) { halt } 
  else { /msg %chan3 $c1 $+ Fileserver Online $+ $c2 $c1 $+ Trigger =  $+ %fs.trig $+  $+ $c2 $c1 $+ Sends = $send(0) $+ / $+ %maxs $+ $c2 $c1 $+ Online = $fserv(0) $+ / $+ %fs.alls $+ $c2 $c1 $+ Acessed = %Fs.trigge Time(s)  $+ $c2 $c1 $+ Files = $findfile(%fs.dir,*,0) $+ $c2 
  /msg %chan3 $c1 $+ Maxcps = $round($calc(%top.cps / 1024),2) Kbps $+ $c2 $c1 $+ Note =  $+ %fs.cont $+  $+ $c2 $logo }
  if (%chan4 == $null) { halt } 
  else { /msg %chan4 $c1 $+ Fileserver Online $+ $c2 $c1 $+ Trigger =  $+ %fs.trig $+  $+ $c2 $c1 $+ Sends = $send(0) $+ / $+ %maxs $+ $c2 $c1 $+ Online = $fserv(0) $+ / $+ %fs.alls $+ $c2 $c1 $+ Acessed = %Fs.trigge Time(s)  $+ $c2 $c1 $+ Files = $findfile(%fs.dir,*,0) $+ $c2 
  /msg %chan4 $c1 $+ Maxcps = $round($calc(%top.cps / 1024),2) Kbps $+ $c2 $c1 $+ Note =  $+ %fs.cont $+  $+ $c2 $logo }
  if (%chan5 == $null) { halt } 
  else { /msg %chan5 $c1 $+ Fileserver Online $+ $c2 $c1 $+ Trigger =  $+ %fs.trig $+  $+ $c2 $c1 $+ Sends = $send(0) $+ / $+ %maxs $+ $c2 $c1 $+ Online = $fserv(0) $+ / $+ %fs.alls $+ $c2 $c1 $+ Acessed = %Fs.trigge Time(s)  $+ $c2 $c1 $+ Files = $findfile(%fs.dir,*,0) $+ $c2 
  /msg %chan5 $c1 $+ Maxcps = $round($calc(%top.cps / 1024),2) Kbps $+ $c2 $c1 $+ Note =  $+ %fs.cont $+  $+ $c2 $logo }
  if (%chan6 == $null) { halt } 
  else { /msg %chan6 $c1 $+ Fileserver Online $+ $c2 $c1 $+ Trigger =  $+ %fs.trig $+  $+ $c2 $c1 $+ Sends = $send(0) $+ / $+ %maxs $+ $c2 $c1 $+ Online = $fserv(0) $+ / $+ %fs.alls $+ $c2 $c1 $+ Acessed = %Fs.trigge Time(s)  $+ $c2 $c1 $+ Files = $findfile(%fs.dir,*,0) $+ $c2 
  /msg %chan6 $c1 $+ Maxcps = $round($calc(%top.cps / 1024),2) Kbps $+ $c2 $c1 $+ Note =  $+ %fs.cont $+  $+ $c2 $logo }
}
on 1:SERV:get*:{  if $send(0) == %maxs { .msg =$nick $c1 $+ Sorry the max number of sends are already in progress, please try again later $+ $c2
  halt }
  .msg =$nick $c1 $+ 0,1 Sending $c2 $2-
}
on 1:SERV:help*: {
  msg =$nick 0,1The Following Commands Work In This Fserv!
  msg =$nick $c1 $+ Dir $+ $c2 List contents of directory that you are currently in
  msg =$nick $c1 $+ Cd <directory> $+ $c2 Switches to a specified Directory
  msg =$nick $c1 $+ Cd.. $+ $c2 Moves you back a Directory
  msg =$nick $c1 $+ Get <Filename> Sends you the specified File
  msg =$nick $c1 $+ Bye $+ $c2 Ends the DCC Chat and exits the Fserv
  msg =$nick $c1 $+ Stats $+ $c2 Shows the Stats of This File Server
  msg =$nick $c1 $+ Topcps $+ $c2 Shows TopCPS and info
  msg =$nick $c1 $+ Users $+ $c2 Shows Users on Fserv
}

on 1:open:!: {
  msg =$nick 0,1Welcome To: $logo  $+ $c1 $+ %author $+ $c2 
  msg =$nick 0,1You May Use The Following Commands...
  msg =$nick $c1 $+ Dir $+ $c2 List contents of directory that you are currently in
  msg =$nick $c1 $+ ls $+ $c2 List contents of directory that you are currently in sideways
  msg =$nick $c1 $+ Cd <directory> $+ $c2 Switches to a specified Directory
  msg =$nick $c1 $+ Cd.. $+ $c2 Moves you back a Directory
  msg =$nick $c1 $+ Get <Filename> $+ $c2 Sends you the specified File
  msg =$nick $c1 $+ Bye $+ $c2 Ends the DCC Chat and exits the Fserv
  msg =$nick $c1 $+ Stats $+ $c2 Shows the Stats of This File Server
  msg =$nick $c1 $+ TopCps $+ $c2 Shows TopCPS and info
  msg =$nick $c1 $+ Users $+ $c2 Shows Users on Fserv
  msg =$nick $c1 $+ SuperZero File Server 2001 SuperZeroIRC inc. $+ $c2
}
on 1:SERV:stats*: {
  msg =$nick 4********************************************************************
  msg =$nick $c1 $+ I Have Served %FS.Trigge People $+ $c2
  msg =$nick $c1 $+ I Have Sent %files.sent Files $+ $c2
  msg =$nick $c1 $+ I Have had %sends.fail Sends Failed $+ $c2
  msg =$nick $c1 $+ I Have Recieved %files.rcvd Files $+ $c2
  msg =$nick $c1 $+ Snagged = $round($calc($calc(%mbsent / 1024)/1024),1) $+ MB $+ $c2
  msg =$nick TopCps Set By $c1 $+ %Ptop.cps $+ $c2 $c1 $+ File: %Ftop.cps $+ $c2 $c1 $+ At $round($calc(%top.cps / 1024),2) Kbps $+ $c2
  msg =$nick 4********************************************************************
  if ($send(1).file = $null) goto done
  msg =$nick Have $send(0) Sends in Progress!!!
  :sendstart 
  if ($send(%send).file = $null) goto end
  msg =$nick 4 %send $send(%send)  Has $send(%send).pc  % of $send(%send).file going at: $send(%send).cps Bytes/Sec
  :loop
  inc %send 1
  goto sendstart
  :done 
  msg =$nick I Am Sending  0 Files At The Moment, Hurry up and get one!  
  :end
  /set %send 1
  halt 
}
on 1:SERV:*: {
  if ($1 == topcps) { msg =$nick TopCps Set By $c1 $+ %Ptop.cps $+ $c2 $c1 $+ File: %Ftop.cps $+ $c2 $c1 $+ At $round($calc(%top.cps / 1024),2) Kbps $+ $c2 | halt }
}
on 1:SERV:bye*: msg =$nick 0,1 Good Bye From $me $+ 's File Server provided by $logo
on 1:close:!: {
  if (%fs == off) { halt }
  dec %fs.useds
/notice $nick Thanks For Joining $me on: %fs.trig Provided by $mirc }
alias FservOff {
  if (%fs == OFF) { echo Fserv is Already oFF }
  if (%fs == ON) { 
    set %fs OFF  
    .timerfserve off
    if (%chan1 == $null) { halt }  
    /msg %chan1 $c1 $+ %fs.trig $+ $c2 Is Now Off $logo
    if (%chan2 == $null) { halt } 
    /msg %chan2 $c1 $+ %fs.trig $+ $c2 Is Now Off $logo
    if (%chan3 == $null) { halt } 
    /msg %chan3 $c1 $+ %fs.trig $+ $c2 Is Now Off $logo
    if (%chan4 == $null) { halt } 
    /msg %chan4 $c1 $+ %fs.trig $+ $c2 Is Now Off $logo
    if (%chan5 == $null) { halt } 
    /msg %chan5 $c1 $+ %fs.trig $+ $c2 Is Now Off $logo
    if (%chan6 == $null) { halt } 
    /msg %chan6 $c1 $+ %fs.trig $+ $c2 Is Now Off $logo
  }
}
on *:OPEN:!:/inc %fs.useds

on *:FILESENT:*: {
  if ($nick == $me) halt
  inc %files.sent
  if ((%top.cps == $null) || (%top.cps !isnum)) { goto topit }
  elseif ($send($nick).cps >= %top.cps) { goto topit }
  else { halt }
  :topit
  set %top.cps $send($nick).cps
  set %Ptop.cps $nick
  set %Ftop.cps $nopath($filename)
  if ($nick = $me) halt
}

on 1:SENDFAIL:*: { 
  inc %sends.fail
  .notice $nick $cg(I Failed To Send You:) $+  $+ %spc $nopath($filename) 
}
on 1:FILERCVD:*: { 
  inc %files.rcvd
  .notice $nick $cg(Thanks for sending me:) $+ %spc $nopath($filename)  
  echo -a $cg(Successfully Recieved:) $+  $+ %spc $nopath($filename)
}
